let fs = require("fs")

let options = {
    highWaterMark: 1 * 1024 * 1024
}
let rs = fs.createReadStream("./赵丽颖、冯绍峰 - 知否知否.mp3", options)
let ws = fs.createWriteStream("./demo.mp3")
rs.on("open", () => {
    console.log("可读流打开了")
})
rs.on("close", () => {
    console.log("可读流关闭了")
    ws.close()
})
ws.on("open", () => {
    console.log("可写流打开了")
})
ws.on("close", () => {
    console.log("可写流关闭了")
})

rs.on("data", (data) => {
    console.log(data.length)
    ws.write(data)
})